<?php
namespace Home\Model;
use \Frame\Libs\BaseModel;

final class PayModel extends BaseModel{
    public function addNewPay($uid,$out_trade_no,$money,$type){
        $sql = "INSERT INTO love_donate_money (uid,trade_no,money,donate_money_time,type) VALUES ('$uid','$out_trade_no','$money',now(),'$type')";
        return $this->pdo->exec($sql);
    }
    
    public function aaa(){
        $sql = "SELECT * FROM love_donate_money WHERE donate_money_id='1'";
        return $this->pdo->fetchOne($sql);
    }
    
    public function fetchOne($trade_no){
        $sql = "SELECT * FROM love_donate_money WHERE trade_no='$trade_no'";
        return $this->pdo->fetchOne($sql);
    }
    
    //设为已支付
    public function setPaid($trade_no){
        $sql = "UPDATE love_donate_money SET status='1' WHERE trade_no='$trade_no'";
        return $this->pdo->exec($sql);
    }
    
}
?>